package com.example.rabbit.config;

import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Author:MuJiuTian
 * @Description:所有的exchange列表
 * @Date: Created in 下午11:04 2019/8/19
 */
/*@Component
@Configuration*/
public class ExchangeConfig {

    /**
     * 创建类型：fanout交换机
     */

    @Bean
    public FanoutExchange fanoutExchange() {
        return new FanoutExchange("log.fanout",true,false,null);
    }

    /**
     * 创建类型：direct交换机
     */
    @Bean
    public DirectExchange directExchange() {
        return new DirectExchange("log.direct",true,false,null);
    }

    /**
     * 创建类型：topic交换机
     */
    @Bean
    public TopicExchange topicExchange() {
        return new TopicExchange("log.topic",true,false,null);
    }



}
